<?php
function validatephone($phone2=''){
	$ci =& get_instance();
	$ci->load->library('form_validation');
	if(strlen($phone2)<=0){
		return true;
	}
 	$phone2=str_replace('-','',$phone2);
 	if(strlen($phone2)!=7){
 		$ci->form_validation->set_message( 'validatephone', 'The %s field must be exactly 7 numberics in length' );
 		return false;
 	}else{
 		return true;	
 	}
}
?>
